package com.matt.foundation.vo.course;

import com.matt.domain.course.CourseTopic;
import lombok.Data;

import javax.persistence.Column;
import java.util.Date;
import java.util.Objects;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/3/9
 * *******************************
 */
@Data
public class CourseTopicPageVo {
    private String id;

    private Long topicMonth;

    private Long beginDate;

    private Long endDate;

    private String name;

    private String targetObject;

    private Integer courseNum;

    public static CourseTopicPageVo of(Object[] objects) {
        CourseTopicPageVo vo = new CourseTopicPageVo();
        vo.setId(objects[0] == null ? "" : objects[0].toString());
        vo.setTopicMonth(objects[1] == null ? 0L : ((Date) objects[1]).getTime());
        vo.setBeginDate(objects[2] == null ? 0L : ((Date) objects[2]).getTime());
        vo.setEndDate(objects[3] == null ? 0L : ((Date) objects[3]).getTime());
        vo.setName(objects[4] == null ? "" : objects[4].toString());
        vo.setTargetObject(objects[5] == null ? "" : objects[5].toString());
        vo.setCourseNum(objects[6] == null ? 0 : Integer.valueOf(objects[6].toString()));
        return vo;
    }
}
